<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">

	<ui:composition template="/templates/masterLayout.xhtml">
		<ui:define name="content">
			<h:form id="traLuongListFormId">
				<p:dataTable id="traLuongDataTableId" value="#{traLuongView.dataModel}" selection="#{traLuongView.selectedEntities}"
					paginator="true" var="entity" rows="10"
					paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
					lazy="true" paginatorPosition="bottom">
					<p:ajax event="rowDblselect" listener="#{traLuongView.editAction}" partialSubmit="true"
						oncomplete="traLuongDialog.show()" update=":traLuongDetailFormId:traLuongPanelGridId" />
					<f:facet name="header">
						<p:commandButton icon="ui-icon-plus" value="Tất toán" action="#{traLuongView.newAction(true)}"
							actionListener="#{traLuongView.reset}" update=":traLuongDetailFormId:traLuongPanelGridId"
							oncomplete="traLuongDialog.show()" style="float:left" />
						<p:commandButton icon="ui-icon-plus" value="Tạm ứng" action="#{traLuongView.newAction(false)}"
							actionListener="#{traLuongView.reset}" update=":traLuongDetailFormId:traLuongPanelGridId"
							oncomplete="traLuongDialog.show()" style="float:left" />
						<p:commandButton icon="ui-icon-plus" value="Bảng lương tháng" action="#{traLuongView.newAction}"
							actionListener="#{traLuongView.reset}" update=":traLuongDetailFormId:traLuongPanelGridId"
							oncomplete="traLuongDialog.show()" style="float:left" />
						<div style="clear: both;" />
					</f:facet>
					<p:column selectionMode="multiple" style="width:1%" />
					<p:column headerText="Tháng-Năm">
						<h:outputText converter="yearMonthConverter" value="#{entity.yearMonth}" />
					</p:column>
					<p:column headerText="Nhân viên">
						<h:outputText value="#{entity.nhanVien.name}" />
					</p:column>
					<p:column headerText="Số tiền">
						<h:outputText value="#{entity.phieuThanhToan.soTien}" />
					</p:column>
					<p:column headerText="Ngày trả">
						<h:outputText value="#{entity.phieuThanhToan.ngayThanhToan}" />
					</p:column>
					<p:column headerText="Loại">
						<h:outputText value="#{entity.loai}" />
					</p:column>
					<f:facet name="footer">
					</f:facet>
				</p:dataTable>
			</h:form>

			<ui:include src="traLuongDetails.xhtml" />
		</ui:define>
	</ui:composition>


</ui:composition>